package com.eshop.modules.security.security;

import java.io.IOException;
import org.springframework.security.access.AccessDeniedException;
import javax.servlet.http.HttpServletResponse;
import javax.servlet.http.HttpServletRequest;
import org.springframework.stereotype.Component;
import org.springframework.security.web.access.AccessDeniedHandler;

@Component
public class JwtAccessDeniedHandler implements AccessDeniedHandler
{
    public void handle(final HttpServletRequest request, final HttpServletResponse response, final AccessDeniedException accessDeniedException) throws IOException {
        response.sendError(403, accessDeniedException.getMessage());
    }
}
